home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / asmclock.arj / TIME.H < prev    next >
C/C++ Source or Header  |  1990-10-18  |  3KB  |  115 lines

  1. /***
  2. *time.h - definitions/declarations for time routines
  3. *
  4. *    Copyright (c) 1985-1990, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *    This file contains the various declarations and definitions
  8. *    for the time routines.
  9. *    [ANSI/System V]
  10. *
  11. ****/
  12.  
  13. #if defined(_DLL) && !defined(_MT)
  14. #error Cannot define _DLL without _MT
  15. #endif
  16.  
  17. #ifdef _MT
  18. #define _FAR_ _far
  19. #else
  20. #define _FAR_
  21. #endif
  22.  
  23. /* implementation defined time types */
  24.  
  25. #ifndef _TIME_T_DEFINED
  26. typedef long time_t;
  27. #define _TIME_T_DEFINED
  28. #endif
  29.  
  30. #ifndef _CLOCK_T_DEFINED
  31. typedef long clock_t;
  32. #define _CLOCK_T_DEFINED
  33. #endif
  34.  
  35. #ifndef _SIZE_T_DEFINED
  36. typedef unsigned int size_t;
  37. #define _SIZE_T_DEFINED
  38. #endif
  39.  
  40. /* structure for use with localtime(), gmtime(), etc. */
  41.  
  42. #ifndef _TM_DEFINED
  43. struct tm {
  44.     int tm_sec;    /* seconds after the minute - [0,59] */
  45.     int tm_min;    /* minutes after the hour - [0,59] */
  46.     int tm_hour;    /* hours since midnight - [0,23] */
  47.     int tm_mday;    /* day of the month - [1,31] */
  48.     int tm_mon;    /* months since January - [0,11] */
  49.     int tm_year;    /* years since 1900 */
  50.     int tm_wday;    /* days since Sunday - [0,6] */
  51.     int tm_yday;    /* days since January 1 - [0,365] */
  52.     int tm_isdst;    /* daylight savings time flag */
  53.     };
  54. #define _TM_DEFINED
  55. #endif
  56.  
  57.  
  58. /* define NULL pointer value */
  59.  
  60. #ifndef NULL
  61. #if (_MSC_VER >= 600)
  62. #define NULL    ((void *)0)
  63. #elif (defined(M_I86SM) || defined(M_I86MM))
  64. #define NULL    0
  65. #else
  66. #define NULL    0L
  67. #endif
  68. #endif
  69.  
  70.  
  71. /* clock ticks macro - ANSI version */
  72.  
  73. #define CLOCKS_PER_SEC    1000
  74.  
  75. /* clock ticks macro - archaic version */
  76.  
  77. #define CLK_TCK     1000
  78.  
  79.  
  80. /* extern declarations for the global variables used by the ctime family of
  81.  * routines.
  82.  */
  83.  
  84. #ifdef _DLL
  85. extern int _FAR_ _cdecl daylight;     /* non-zero if daylight savings time is used */
  86. extern long _FAR_ _cdecl timezone;    /* difference in seconds between GMT and local time */
  87. extern char _FAR_ * _FAR_ _cdecl tzname[2]; /* standard/daylight savings time zone names */
  88. #else
  89. extern int _near _cdecl daylight;     /* non-zero if daylight savings time is used */
  90. extern long _near _cdecl timezone;    /* difference in seconds between GMT and local time */
  91. extern char * _near _cdecl tzname[2]; /* standard/daylight savings time zone names */
  92. #endif
  93.  
  94.  
  95. /* function prototypes */
  96.  
  97. #ifdef _MT
  98. double _FAR_ _pascal difftime(time_t, time_t);
  99. #else
  100. double _FAR_ _cdecl difftime(time_t, time_t);
  101. #endif
  102.  
  103. char _FAR_ * _FAR_ _cdecl asctime(const struct tm _FAR_ *);
  104. char _FAR_ * _FAR_ _cdecl ctime(const time_t _FAR_ *);
  105. clock_t _FAR_ _cdecl clock(void);
  106. struct tm _FAR_ * _FAR_ _cdecl gmtime(const time_t _FAR_ *);
  107. struct tm _FAR_ * _FAR_ _cdecl localtime(const time_t _FAR_ *);
  108. time_t _FAR_ _cdecl mktime(struct tm _FAR_ *);
  109. size_t _FAR_ _cdecl strftime(char _FAR_ *, size_t, const char _FAR_ *,
  110.     const struct tm _FAR_ *);
  111. char _FAR_ * _FAR_ _cdecl _strdate(char _FAR_ *);
  112. char _FAR_ * _FAR_ _cdecl _strtime(char _FAR_ *);
  113. time_t _FAR_ _cdecl time(time_t _FAR_ *);
  114. void _FAR_ _cdecl tzset(void);
  115.